package ControlLayer;
import ModelLayer.Address;
import DBLayer.DBAddress;
import java.util.ArrayList;

public class CtrAddress {
    // <editor-fold defaultstate="collapsed" desc="Attributes & Constructors">
    private static CtrAddress instance = null;
    DBAddress dbAddress = new DBAddress();

    public CtrAddress() {
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Methods">
    public static CtrAddress getInstance() {
        if (instance == null) {
            instance = new CtrAddress();
        }
        return instance;
    }

    public ArrayList<Address> getAddressList() {
        return dbAddress.getAddressList();
    }

    public Address getAddressByID(int id) {
        return dbAddress.getAddressByID(id);
    }

    public int addAddress(Address address) {
        return dbAddress.addAddress(address);
    }

    public int updateAddress(Address address, int id) {
        return dbAddress.updateAddress(address, id);
    }

    public void deleteAddress(int id) {
        dbAddress.deleteAddress(id);
    }
    // </editor-fold>
}
